package com.atguigu.service.Impl;

import com.atguigu.mapper.DeptMapper;
import com.atguigu.pojo.Dept;
import com.atguigu.service.DeptService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: liuaojun
 * @CreateTime: 2025-02-07
 * @Description:
 * @Version: 1.0
 */
@Service
public class DeptServiceImpl implements DeptService {
    @Autowired
    private DeptMapper deptMapper;

    @Override
    public void insertDept(Dept dept) {
        deptMapper.insertDept(dept);
    }

    @Override
    public void updateDept(Dept dept) {
        deptMapper.updateDept(dept);
    }

    @Override
    public void deleteDept(Integer did) {
        deptMapper.deleteDept(did);
    }

    @Override
    public Dept SelectDeptByEid(Integer did) {
        Dept dept = deptMapper.selectDeptById(did);
        return dept;
    }

    @Override
    public List<Dept> selectAllDept() {
        List<Dept> depts = deptMapper.selectDeptAll();
        return depts;
    }
}
